package com.doit.hbase.client;

import com.doit.hbase.utils.HbaseUtils;
import org.apache.hadoop.hbase.NamespaceDescriptor;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;

/**
 * @DATE 2021/12/13/17:57
 * @Author MDK
 * @Version 2021.2.2
 * 创建名称空间
 **/
public class C07_CreateNS {
    public static void main(String[] args) throws Exception {
        Connection conn = HbaseUtils.getConnection();
        Admin admin = HbaseUtils.getAdmin(conn);
        NamespaceDescriptor.Builder builder = NamespaceDescriptor.create("lang");
        NamespaceDescriptor namespaceDescriptor = builder.build();
        admin.createNamespace(namespaceDescriptor);

        admin.close();
        conn.close();
    }
}
